package top.lemcoo.mybatis.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import top.lemcoo.common.entity.User;
import top.lemcoo.mybatis.service.UserService;

/**
 * 【】
 *
 * @Author: zhaowx
 * @Date: 2020/7/21 21:55
 */
@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/user/{id}")
    public String getUser(@PathVariable("id") Integer id){
        return userService.getUserById(id).toString();
    }
}
